package it.asvp.asvp_portal.web.controller;

import it.asvp.asvp_portal.asvp_util.util.Constants;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
@RequestMapping("/home")
public class HomeController {

	private static final Log log = LogFactory.getLog(HomeController.class);
	
	@RequestMapping(method = RequestMethod.GET)
	public ModelAndView home(final HttpServletRequest request,final HttpServletResponse response) {

		log.info("Accesso alla homepage");
		
		final ModelAndView mv = new ModelAndView("home");
		mv.addObject(Constants.Param.PARTNER, "lista dei partner asvp");
		mv.addObject(Constants.Param.EVENT, "lista degli eventi");
		mv.addObject(Constants.Param.NEWS, "lista delle notizie");
		mv.addObject(Constants.Param.CONVENTION, "convenzioni attive");
		return mv;	
	}
}
